arr = [['M', 1000], ['CM', 900], ['D', 500], ['CD', 400], ['C', 100], ['XC', 90], [
    'L', 50], ['XL', 40], ['X', 10], ['IX', 9], ['V', 5], ['IV', 4], ['I', 1]]


class Solution:
    def intToRoman(self, num: int) -> str:
        res = ''
        for i in arr:
            if(i[1] > num):
                continue
            elif(i[1] == num):
                res = res+i[0]
                return res
            else:
                n = int(num/i[1])
                for j in range(0, n):
                    num = num-i[1]
                    res = res+i[0]

        return res


if __name__ == "__main__":
    print(Solution().intToRoman(1994))
    print(Solution().intToRoman(1994))
    print(Solution().intToRoman(1994))
